<?php
$_SESSION ['pathway'] = '..';
require_once ($_SESSION ['pathway'] . "/commun/ouvre_base.php");

if (isset ( $_POST ['date'] ) and $_POST ['date'] != '') {
	$date = $_POST ['date'];
}
if (isset ( $_POST ['user'] ) and $_POST ['user'] != '') {
	$user = $_POST ['user'];
}
if (isset ( $_POST ['nip'] ) and $_POST ['nip'] != '') {
	$nip = $_POST ['nip'];
}
if (isset ( $_POST ['site'] ) and $_POST ['site'] != '') {
	$site = $_POST ['site'];
}
$site = strtoupper ( $site );
if (isset ( $_POST ['sex'] ) and $_POST ['sex'] != '') {
	$sex = $_POST ['sex'];
}
if (isset ( $_POST ['birthdate'] ) and $_POST ['birthdate'] != '') {
	$birthdate = $_POST ['birthdate'];
}
if (isset ( $_POST ['location'] ) and $_POST ['location'] != '') {
	$location = $_POST ['location'];
}
if (isset ( $_POST ['location_other'] ) and $_POST ['location_other'] != '') {
	$location_other = $_POST ['location_other'];
}
if (isset ( $_POST ['diagnostic'] ) and $_POST ['diagnostic'] != '') {
	$diagnostic = implode ( $_POST ['diagnostic'], ', ' );
} // array
if (isset ( $_POST ['diagnostic_other'] ) and $_POST ['diagnostic_other'] != '') {
	$diagnostic_other = $_POST ['diagnostic_other'];
}
if (isset ( $_POST ['diagnostic_genetique'] ) and $_POST ['diagnostic_genetique'] != '') {
	$diagnostic_genetique = $_POST ['diagnostic_genetique'];
}
if (isset ( $_POST ['diagnostic_complet'] ) and $_POST ['diagnostic_complet'] != '') {
	$diagnostic_complet = $_POST ['diagnostic_complet'];
}
$diagnostic_complet = mysql_real_escape_string ( $diagnostic_complet );
if (isset ( $_POST ['mode'] ) and $_POST ['mode'] != '') {
	$mode = implode ( $_POST ['mode'], ', ' );
} // array
if (isset ( $_POST ['mode_other'] ) and $_POST ['mode_other'] != '') {
	$mode_other = $_POST ['mode_other'];
}
if (isset ( $_POST ['nouveau_patient'] ) and $_POST ['nouveau_patient'] != '') {
	$nouveau_patient = $_POST ['nouveau_patient'];
}
if (isset ( $_POST ['prise_en_charge'] ) and $_POST ['prise_en_charge'] != '') {
	$prise_en_charge = $_POST ['prise_en_charge'];
}
if (isset ( $_POST ['contexte_prise_en_charge'] ) and $_POST ['contexte_prise_en_charge'] != '') {
	$contexte_prise_en_charge = $_POST ['contexte_prise_en_charge'];
}
if (isset ( $_POST ['orientation_personnalisee'] ) and $_POST ['orientation_personnalisee'] != '') {
	$orientation_personnalisee = implode ( $_POST ['orientation_personnalisee'], ', ' );
} // array
if (isset ( $_POST ['orientation_personnalisee_other'] ) and $_POST ['orientation_personnalisee_other'] != '') {
	$orientation_personnalisee_other = $_POST ['orientation_personnalisee_other'];
}

$query_remplissage_fiche_activite = "INSERT INTO `spatax`.`fiche_activite` (`user`,
`nip`, `date`, `site`, `sex`, `birthdate`, `location`, `location_other`, `diagnostic`, 
`diagnostic_other`, `diagnostic_genetique`, `diagnostic_complet`, `mode`, `mode_other`, 
`nouveau_patient`, `prise_en_charge`, `contexte_prise_en_charge`, `orientation_personnalisee`, 
`orientation_personnalisee_other`) VALUES (
'$user','$nip', '$date', '$site', '$sex', '$birthdate', '$location', '$location_other ', '$diagnostic', 
'$diagnostic_other ', '$diagnostic_genetique ', '$diagnostic_complet ', '$mode', '$mode_other ', '$nouveau_patient ', 
'$prise_en_charge ', '$contexte_prise_en_charge ', '$orientation_personnalisee ', '$orientation_personnalisee_other ');";

mysql_query ( $query_remplissage_fiche_activite ) or die ( "Entry not valid : " . mysql_error () );

?>

